<?php
include_once "common.php";
//数组[key1=>value1,key2=>value2,...]
$a=[111,3,5,100=>"hello",true];
var_dump($a);
$a=['name'=>'张三','age'=>18,'sex'=>'男'];
print_r($a);
$a=['24jsj1','name'=>'张三',0=>'24jsj2','name'=>'张三丰',];
print_r($a);


$array=array(
    1=>'a',
    '1'=>'b',
    1.5=>'c',
    -1=>'d',
    '01'=>'e',
    '1.5'=>'f',
    true=>'g',
    false=>'h',
    ''=>'i',
null=>'j',
'k',
2=>'1',
);
p($array);
$a=[111,222,333,"hello",true];
for($i=0,$len=count($a);$i<$len;++$i){
echo $i,'. ',$a[$i],"\n";
}
echo "--------------------------------\n";
$a=[111,222,10=>333,"hello",true];
foreach ($a as $v){
    echo  $v,"\n";
}
echo "--------------------------------\n";
$a=[111,'name'=>'zhangsan',345,'age'=>18];
foreach ($a as $key=>$value){
    echo $key,'--->',  $value,"\n";
}